import { http } from '@/utils/request'

import type { IData, IFindUserAddressList, ISubmit, ITradeMsg } from '@/types/trade'



/**
 * @description 获取用户收货地址
 * @returns 
 */
export const reqAddress = () => {
    return http<IFindUserAddressList[]>('/api/user/userAddress/auth/findUserAddressList','GET')
}



/**
 * @description获取交易页购买商品列表信息
 */
export const reqTrade = () => {
    return http<IData>('/api/order/auth/trade','GET')
}


/**
 * @description 提交订单
 * @param tradeNo 
 * @returns 
 */
export const reqSubmit = (tradeNo:string,data:ISubmit) => {
    return http<ITradeMsg>(`/api/order/auth/submitOrder?tradeNo=${tradeNo}`,'POST',data)
}